
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<script language="javascript" src="js/lianxi05.js"></script>	
		<title>表格</title>
	</head>

<body>

		<TABLE width="500" border="1" id="t"  onClick="setPos(this)">
			<TR>
				<TD>
					<div contentEditable>项目部门</div>
				</TD>
				<TD>
					<div contentEditable>部门1</div>
				</TD>
				<TD>
					<div contentEditable>部门2</div>
				</TD>
				<TD>
					<div contentEditable>部门3</div>
				</TD>
				<TD>
					<div contentEditable>统计</div>
				</TD>
			</TR>
			<TR>
				<TD>
					<div contentEditable>货物1</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div>0</div>
				</TD>
			</TR>
			<TR>
				<TD>
					<div contentEditable>货物2</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div>0</div>
				</TD>
			</TR>
			<TR>
				<TD>
					<div contentEditable>货物3</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div>0</div>
				</TD>
			</TR>
			<TR>
				<TD>
					<div contentEditable>货物4</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div>0</div>
				</TD>
			</TR>
			<TR>
				<TD>
					<div contentEditable>货物5</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div contentEditable>0</div>
				</TD>
				<TD>
					<div>0</div>
				</TD>
			</TR>
			<TR>
				<TD>
					<div contentEditable>总计</div>
				</TD>
				<TD>
					<div>0</div>
				</TD>
				<TD>
					<div>0</div>
				</TD>
				<TD>
					<div>0</div>
				</TD>
				<TD>
					<div>0</div>
				</TD>
			</TR>
		</TABLE>
		<input type="button" value="加一行" onClick="insertRow(document.all.t)">
		<input type="button" value="加一列" onClick="insertCell(document.all.t)">
		<input type="button" value="删除行" onClick="deleteRow(document.all.t)">
		<input type="button" value="删除列" onClick="deleteCell(document.all.t)">
		<br/>
		<input type="button" value="正序排列" onClick="ascRow(document.all.t)">
		<input type="button" value="倒序排列" onClick="descRow(document.all.t)">
		<input type="button" value="横向正序排列" onClick="ascCell(document.all.t)">
		<input type="button" value="横向倒序排列" onClick="descCell(document.all.t)">
		<br/>
		<input type="button" value="统计" onClick="sum(document.all.t)">
		<input type="button" value="全部数据统计" onClick="getSum(document.all.t,'total')">
		<input type="text" value="0" name="total" style="width:50">
	</body>

</html>